home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac100% 1999 April
/
MAC100-1999-04.ISO.7z
/
MAC100-1999-04.ISO
/
オンラインソフト定点観測
/
Graphics
/
X-TRACE67.lzh
/
XTRACE R67
/
X-TRACE
/
X-TRACE.rsrc
/
TEXT_757_vrml_sph.xti.txt
< prev
next >
Wrap
Text File
|
1999-01-31
|
980b
|
63 lines
modela "Sphere for VRML-MODELA bridge"
{
nvar vrml.sph.smooth=120;
nvar vrml.sph.pn=10;
smooth vrml.sph.smooth : model
{
var vrml.sph.pn2=int (vrml.sph.pn/2);
var r=vrml.sph.radius;
var h=r;
var t1,t2;
var c1,c2,s1,s2;
var r1,r2,y1,y2;
var x1,z1,x2,z2,x3,z3,x4,z4;
sim r,h,r;
boundary sphere 0,0,0, 1
{
var i,j;
attr vrml_attr_0;
j=0;
while (j<vrml.sph.pn2)
{
t1=PI*j/vrml.sph.pn2;
t2=PI*(j + 1)/vrml.sph.pn2;
y1=cos (t1);
r1=sin (t1);
y2=cos (t2);
r2=sin (t2);
i=0;
while (i<vrml.sph.pn)
{
t1=2*PI*i/vrml.sph.pn;
t2=2*PI*(i + 1)/vrml.sph.pn;
c1=cos (t1);
s1=sin (t1);
c2=cos (t2);
s2=sin (t2);
x1=r1*c1;
z1=r1*s1;
x2=r1*c2;
z2=r1*s2;
x3=r2*c1;
z3=r2*s1;
x4=r2*c2;
z4=r2*s2;
poly
{
pt x1,y1,z1;
pt x2,y1,z2;
pt x4,y2,z4;
pt x3,y2,z3;
}
i=i + 1;
}
j=j + 1;
}
}
}
}